package hevs.eServices.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Hyperlink;

public class ExternalLink extends Anchor{
	
	
	public ExternalLink(String text, String url){
		
		setStyleName("external_link");
		setText(text);
		addClickHandler(new LinkHandler(url));
	}
	
	private class LinkHandler implements ClickHandler{
		
		private String url;
		
		public LinkHandler(String url){
			super();
			this.url = url;
		}

		@Override
		public void onClick(ClickEvent event) {
			// TODO Auto-generated method stub
			Window.open(this.url, "", "");
		}
		
	}

}
